| Miles Sound System SDK 7.2a |
Q: | What is MPEG Audio and MP3? |
A: | MPEG audio is a standard that was created to compress the audio streams that accompany MPEG video streams. Because it was invented almost 8 years ago, MPEG audio needed to be scalable in playback complexity. The MPEG group, therefore, came up with three levels of compression complexity: MPEG Layer 1, MPEG Layer 2, and MPEG Layer 3. Each level provided almost twice the audibly lossless compression ratio (MP1 provides 3 to 1, MP2 provides 6 to 1, and MP3 provides 11 to 1), but each level required more and more CPU horsepower. However, now, 8 years later, even the sophisticated Layer 3 compression standard only uses a small percentage of the total power of a modern desktop CPU. This means we can now take advantage of the massive size savings that MPEG Layer 3 can provide! For example, at the usual compression ratio of 11 to 1, this means you could store up to 13.5 hours of audio on one CD! And remember, this is audibly lossless compression - you can't hear any difference! Before MSS, one bad aspect to using MP3 compression was the fact that two overseas companies owned the compression and decompression patent rights to the MP3 algorithm. That meant that if you wanted to add MP3 to your commercial product, then you had to go through a convoluted and lengthy licensing process to obtain an expensive license. Worse, you were simply paying for the patent rights - you still had to write the MP3 decoder itself! However, with the Miles Sound System, we have arranged through Fraunhofer and Thomson multimedia to provide a legally redistributable MP3 decoder for no extra cost! You must sign an extra MPEG license addendum (which, among other minor things, requires you to add a credit to Fraunhofer and Thomson in your game), but, other than that, you can use MP3 decompression just like our already built-in IMA ADPCM decompression. More about that in a minute, though. Now, MPEG Layer 3 encoding is a completely different situation. RAD does sell an MPEG Layer 3 encoder, but does so completely separately from the Miles Sound System. This MP3 encoder is available from us on a per-machine basis for $95.00. Note that you cannot redistribute this encoder - it is for your use only. To obtain a redistributable encoder, give us a call and we can get you in touch with the right people at Fraunhofer. The Miles MP3 encoder is based on the ISO reference source code. This means that while the sound quality of the compression is very good, the compression speed is very, very slow. It can take up to 5 minutes to compress a single 3 minute WAV file! The ISO reference source also has one other limitation - it can only compress 32 Khz, 44 Khz, and 48 Khz data rates. That means that if you try to compress a 22 Khz input file, the Miles encoder will upsample it to 32 Khz and then compress it (which obviously hurts the overall compression ratio). Because of these limitations, you may want to look at alternative MP3 compressors - this is a highly competitive field and there are many very good, very fast MP3 encoders available (including ones that support other sample rates - 16, 22 and 24 Khz). See the MP3.COM web site for links to many different encoders. The Fraunhofer encoders are generally found to be the very best (and are relatively inexpensive). One feature that the other encoders don't have, however, is the ability to compress the instruments in a DLS file. Only the Miles MP3 encoder can currently perform this specific type of compression (which can compress DLS files up to 11 to 1). With this feature, the Miles MP3 encoder can give you incredibly small digital music files. For example, on our web site are several DLS files that are under 1 MB is size, yet contain 7 to 10 MBs of instrument data! OK, now let's talk about the Miles MP3 decoder. First off, the Miles MP3 decoder is just that: an MP3 decoder. Miles cannot decode or playback MPEG Layer 1 or MPEG Layer 2 compressed audio. You must uncompress data compressed with the simpler formats with a non-Miles utility, and then recompress it using MP3. However, since MP3 is 4 times as small as MP1 and 2 times as small as MP2, this should be to your advantage once the data is converted. Once the Miles MP3 decoder is installed, MP3 data is treated like a completely integrated sound type - the data doesn't even have to be decompressed before passing it to Miles! However, the MP3 decompression process does take more CPU than the comparatively simple IMA ADPCM algorithm. To solve this problem, Miles also allows you to pre-decompress MP3 data. This way, if CPU-performance is critical, then you can decompress the MP3 files ahead of time (say when you load the game level data). If, however, memory is critical and CPU-performance isn't important, then you could decompress all of the MP3 files on the fly. The choice is up to you! Since an MPEG Layer 3 file contains just the compressed data (MP3 files don't really have an identifying header), you must use a new function called AIL_set_named_sample_file to tell Miles that it is dealing with MP3-compressed data. There is one exception to this - Microsoft has defined a special type of WAV file that can contain MP3 data (basically the MP3 data is wrapped up into a RIFF chunk). If you use this weird WAV file format, then Miles can use the same old AIL_set_sample_file function that you've always used to load sound data. However, not all encoders (including the Miles MP3 encoder) support this WAV file wrapping system, so most of the time you should use the new AIL_set_named_sample_file function (which works with either type of MP3 file). |
Next Topic (What MP3 encoder should I use?)
Previous Topic (What kind of audio decompression does Miles support?)
Group:
FAQs and How Tos
Related Functions:
AIL_set_named_sample_file, AIL_set_sample_file
Related FAQs:
What kind of audio decompression does Miles support?
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.